<div class="triggers">
  <div class="builds" ng-repeat="trigger in triggers">
    <div ng-if="trigger.type === 'ImageChange'">
      <div ng-repeat="build in buildsByOutputImage[(trigger.imageChangeParams.from | imageObjectRef : namespace)] | orderObjectsByDate : true track by (build | uid)"
          ng-show="!(hideBuild)"
          class="build animate-repeat hide-ng-leave"
          kind="Build"
          resource="build">
        <div class="build-summary" ng-class="{'dismissible' : !(build | isIncompleteBuild)}">
          <div class="build-name">
            <span ng-if="build | annotation : 'buildNumber'">
              <a ng-if="build | buildConfigForBuild" ng-href="{{(build | buildConfigForBuild) | navigateResourceURL : 'BuildConfig' : build.metadata.namespace}}">{{build | buildConfigForBuild}}</a><span ng-if="build | buildConfigForBuild">,</span>
              <a ng-href="{{build | navigateResourceURL}}">
                #{{build | annotation : 'buildNumber'}}
              </a>
            </span>
            <span ng-if="!(build | annotation : 'buildNumber')">
              {{build.metadata.name}}
            </span>
          </div>
          <div class="build-phase">
            <status-icon status="build.status.phase"></status-icon>
            {{build.status.phase}}<span ng-if="build | isIncompleteBuild">. A new deployment will be created automatically once the build completes.</span>
          </div>
          <relative-timestamp timestamp="build.metadata.creationTimestamp" class="build-timestamp"></relative-timestamp>
          <div ng-if="'builds/log' | canI : 'get'" class="build-links">
            <a ng-if="!!['New', 'Pending'].indexOf(build.status.phase) && (build | buildLogURL)" ng-href="{{build | buildLogURL}}">View Log</a>
          </div>
          <build-close build="build" hide-build="hideBuild"></build-close>
        </div>
      </div>
    </div>
  </div>
</div>
